<!DOCTYPE html>
<html lang="ch">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
    <script src="js/vue.min.js"></script>

</head>
<body>
    <h1>vue双向绑定</h1>
    <div id="app">
        <input type="text" v-model="ename">
        <div v-text="ename"></div>
        {{ename}}<br>
        <ul>
            <li v-for="emp in emps">
                {{emp.empno}}-{{emp.ename}}
            </li>
        </ul>

    </div>


<script TYPE="text/javascript">
    var data = {ename:"撒贝宁",
                emps:[
                    {ename:"李荣浩",empno:8080},
                    {ename:"杨丞琳",empno:8009}
                    ]
                 };
    new Vue({
        el:"#app",
        data:data,
        mounted(){
            console.log("mounted()..")
            $.get("emp/list",{"pageNum":1,"size":2},function (data) {
                vm.emps=data.records;
                vm.ename="陈奕迅"；
            })
        }
    })
</script>

</body>
</html>